package org.sgs.reddit.bot.xml.adapter;

import javax.xml.bind.annotation.adapters.XmlAdapter;

public class NoNewLineAdapter extends XmlAdapter<String, String> {

  @Override
  public String unmarshal(String v) throws Exception {
    v = v.trim();
    v = v.replaceAll("\n", " ");
    v = v.trim();
    return v;
  }

  @Override
  public String marshal(String v) throws Exception {
    return v;
  }

}
